#include<bits/stdc++.h>
#define int long long

using namespace std;

signed main() {
	int t;
	cin >> t;
	while(t -- ) {
		int n, k, t = 1;
		cin >> n >> k;
		int a[n + 10];
		map<int, int>mp;
		
		for(int i = 1; i <= n; i ++ ) {
			cin >> a[i];
			mp[a[i]] ++ ;
		}
		bool flag = false;
		for(int i = 1; i <= k; i ++ ) {
			if(mp[i] == 0) {
				flag = true;
				cout << "NO" << endl;
				break;
			}
		}
		if(!flag) {
			cout << "YES" << endl;
		}
	}
	return 0;
}

